import com.suyi.dao.StudentMapper;
import com.suyi.dao.TeacherMapper;
import com.suyi.pojo.Student;
import com.suyi.pojo.Teacher;
import com.suyi.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

/**
 * @authoer 贺先生
 * date 2021-04-18 17:30
 */
public class test {

    public static void main(String[] args) {
        SqlSession sqlSession = MybatisUtils.getSqlSession();

        TeacherMapper mapper = sqlSession.getMapper(TeacherMapper.class);

        Teacher teacher = mapper.getTeacher(1);
            System.out.println(teacher);
        sqlSession.close();

    }

    @Test
    public void test1(){
        SqlSession sqlSession = MybatisUtils.getSqlSession();

        StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);

        List<Student> students= mapper.getStudent2();

        for (Student student : students) {
            System.out.println(student);
        }

        sqlSession.close();
    }
}
